-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not print in bold in print_with_color + other color tweaks #18480
Conversation
@@ -508,7 +508,7 @@ Text I/O | |||
|
|||
Print strings in a color specified as a symbol. | |||
|
|||
``color`` may take any of the values ``:normal``\ , ``:bold``\ , ``:black``\ , ``:blue``\ , ``:cyan``\ , ``:green``\ , ``:magenta``\ , ``:red``\ , ``:white``\ , or ``:yellow``\ . | |||
``color`` may take any of the values ``:normal``\ , ``:bold``\ , ``:black``\ , ``:blue``\ , ``:cyan``\ , ``:green``\ , ``:italics``\ , ``:magenta``\ , ``:red``\ , ``:underline``\ , ``:white``\ , or ``:yellow``\ . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't we have this set up to list styles like normal/bold first, then colors alphabetically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated this + other comment
Great. Maybe also disable bold for the input text. |
That is a too controversial of a change @andreasnoack to handle in this PR :P |
I think the controversial part was the printing. |
This has the effect that if you set the color of |
@@ -508,7 +508,7 @@ Text I/O | |||
|
|||
Print strings in a color specified as a symbol. | |||
|
|||
``color`` may take any of the values ``:underline``\ , ``:normal``\ , ``:italics``\ , ``:bold``\ , ``:black``\ , ``:blue``\ , ``:cyan``\ , ``:dark_gray``\ , ``:green``\ , ``:light_blue``\ , ``:light_cyan``\ , ``:light_green``\ , ``:light_magenta``\ , ``:light_red``\ , ``:light_yellow``\ , ``:magenta``\ , ``:red``\ , ``:white``\ , or ``:yellow``\ . | |||
``color`` may take any of the values ``:underline``\ , ``:normal``\ , ``:italics``\ , ``:bold``\ , ``:black``\ , ``:blue``\ , ``:cyan``\ , ``:dark_gray``\ , ``:default``\ , ``:green``\ , ``:light_blue``\ , ``:light_cyan``\ , ``:light_green``\ , ``:light_magenta``\ , ``:light_red``\ , ``:light_yellow``\ , ``:magenta``\ , ``:red``\ , ``:white``\ , or ``:yellow``\ . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should default also count as formatting rather than color?
are the |
Previously you couldn't have a non default non bold color. I could just surround the "input prints" with unconditional bold and things would be the same as before. I guess the reason things are a bit awkward is that colors and font style are put together in the same dict and the API has been so that you chose a key in that dict. A function with keyword arguments that return the full formatting strig might jave worked better. Regarding light colors and bold, it is terminal dependent. |
Ref https://kristofferc.github.io/OhMyREPL.jl/latest/internals/ansitoken.html for how I do color printing in a package. |
A better API is much needed. |
3bf210f
to
2b73c89
Compare
For now, I have decided to punt on more customization to input/output colors than what is currently available with ENV. As the PR is right now it does not change the current state i.e:
|
32c1a31
to
1e20eb5
Compare
1e20eb5
to
69e1c8d
Compare
Will repoen this because the new attempt is sufficiently different for the discussion here to not be very usable. |
light_red
which is the same color as bold + red previously was on most terminals.with_output_color
does no longer reset all the color state (does not print a\e[0m
in the end) but instead "pops" off the last one. This means you can nest a bold style and a color style inwith_output_color
.